<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>企业客户联系人详情 </title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <!-- Bootstrap 3.3.7 -->
    <!--link导入外部的css，js样式，如果导入的资源和本页面在同一个文件夹下，直接文件名即可-->
    <link rel="stylesheet" th:href="@{/asserts/bower_components/bootstrap/dist/css/bootstrap.min.css}">
    <!-- jQuery 3 -->
    <script th:src="@{/asserts/bower_components/jquery/dist/jquery.min.js}"></script>
    <!-- Bootstrap 3.3.7 -->
    <script th:src="@{/asserts/bower_components/bootstrap/dist/js/bootstrap.min.js}"></script>
    <!-- Font Awesome -->
    <link rel="stylesheet" th:href="@{/asserts/bower_components/font-awesome/css/font-awesome.min.css}">
    <!-- Ionicons -->
    <link rel="stylesheet" th:href="@{/asserts/bower_components/Ionicons/css/ionicons.min.css}">
    <!-- DataTables -->
    <link rel="stylesheet" th:href="@{/asserts/bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css}">
    <!-- Theme style -->
    <link rel="stylesheet" th:href="@{/asserts/dist/css/AdminLTE.min.css}">
    <!-- AdminLTE Skins. Choose a skin from the css/skins
         folder instead of downloading all of them to reduce the load. -->
    <link rel="stylesheet" th:href="@{/asserts/dist/css/skins/_all-skins.min.css}">

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->

    <!-- Google Font -->
    <link rel="stylesheet"
          href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">
    <style type="text/css">
        .search {
            margin-top: 40px;
            margin-left: 40px;
            position: relative;
        }

        td {
            text-align: center;
        }

        th {
            text-align: center;
        }
    </style>

</head>
<body>
<div class="wrapper">
    <!-- Content Wrapper. Contains page content -->
    <!-- Content Header (Page header) -->
    <section class="content-header">
        <h4>
            <i class="fa fa-navicon"></i> 企业客户联系人详情
        </h4>
        <div th:if="${info != null}">
            <a class="btn btn-primary " th:href="@{/contact/saveUI(coContactCompanyId=${coContactCompanyId})}">
                <i class="fa fa-plus"></i> 添加联系人
            </a>
            <a class="btn btn-info " th:href="@{/company/findAll(currentPage=${currentPage},pageSize=${pageSize})}">
                <i class="fa fa-backward"></i> 返回
            </a>
        </div>
    </section>


    <!-- Main content -->
    <section class="content">
        <div class="row">
            <div class="col-xs-12">
                <div class="box">
                    <div th:if="${info != null}" style="width: 270px;margin: auto">
                        <p style="color: #ff0000;font-size: 30px;font-weight: bold">[[${info}]]</p>
                    </div>
                    <!-- /.box-header 部门列表的显示  table  表格  th/td单元个   th字体加粗，行标题-->
                    <div class="box-body" th:if="${info == null}">
                        <form method="post" th:action="@{/contact/deleteAll(coContactCompanyId=${coContactCompanyId})}">
                            <table id="example1" class="table table-bordered table-hover">
                                <tbody>
                                <tr>
                                    <th th:if="${session.user.authority != 3}">选择</th>
                                    <th>联系人姓名</th>
                                    <th>性别</th>
                                    <th>职务</th>
                                    <th>电话</th>
                                    <th>微信</th>
                                    <th>QQ</th>
                                    <th>邮箱</th>
                                    <th>备注</th>
                                    <th>操作</th>
                                </tr>
                                <tr th:each="contact:${contactList}">
                                    <td th:if="${session.user.authority != 3}">
                                        <input type="checkbox" name="coContactIds" class="checks"
                                               th:value="${contact.coContactId}"/>
                                    </td>
                                    <td th:text="${contact.coContactName}"></td>
                                    <td th:text="${contact.coContactGender}"></td>
                                    <td th:text="${contact.coContactDuty}"></td>
                                    <td th:text="${contact.coContactPhone}"></td>
                                    <td th:text="${contact.coContactWechat}"></td>
                                    <td th:text="${contact.coContactQq}"></td>
                                    <td th:text="${contact.coContactEmail}"></td>
                                    <td th:text="${contact.coContactRemarks}"></td>
                                    <td>
                                        <a class="btn btn-warning"
                                           th:href="@{/contact/updateUI(coContactId=${contact.coContactId},coContactCompanyId=${coContactCompanyId})}">
                                            <i class="fa fa-edit"></i> 修改
                                        </a>
                                        <a class="btn btn-danger" onclick="return confirm('确认要删除？')"
                                           th:if="${session.user.authority != 3}"
                                           th:href="@{/contact/deleteById(coContactId=${contact.coContactId},coContactCompanyId=${coContactCompanyId})}">
                                            <i class="fa fa-trash"></i> 删除
                                        </a>
                                    </td>
                                </tr>

                                <tr>
                                    <td th:if="${session.user.authority != 3}">
                                        <label><input type="checkbox" name="" id="all" value=""/>&nbsp;&nbsp;全选</label>

                                    </td>
                                    <td colspan="13" style="text-align:left;padding-left:20px;">
                                        <button th:if="${session.user.authority != 3}" class="btn btn-danger"
                                                onclick="return confirm('确认要删除？')" type="submit">
                                            <i class="fa fa-trash"></i> 删除
                                        </button>
                                        <a class="btn btn-primary "
                                           th:href="@{/contact/saveUI(coContactCompanyId=${coContactCompanyId})}">
                                            <i class="fa  fa-plus"></i> 添加联系人
                                        </a>
                                        <a class="btn btn-info "
                                           th:href="@{/company/findAll(currentPage=${currentPage},pageSize=${pageSize})}">
                                            <i class="fa fa-backward"></i> 返回
                                        </a>
                                    </td>
                                </tr>
                                <tr>
                                </tr>
                                </tbody>
                            </table>
                        </form>
                    </div>
                    <!-- /.box-body -->
                </div>
                <!-- /.box -->
            </div>
            <!-- /.col -->
        </div>
        <!-- /.row -->
    </section>
    <!-- /.content -->
</div>

<!-- ./wrapper -->


<!-- DataTables -->
<script th:src="@{/asserts/bower_components/datatables.net/js/jquery.dataTables.min.js}"></script>
<script th:src="@{/asserts/bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js}"></script>
<!-- SlimScroll -->
<script th:src="@{/asserts/bower_components/jquery-slimscroll/jquery.slimscroll.min.js}"></script>
<!-- FastClick -->
<script th:src="@{/asserts/bower_components/fastclick/lib/fastclick.js}"></script>
<!-- AdminLTE App -->
<script th:src="@{/asserts/dist/js/adminlte.min.js}"></script>
<!-- AdminLTE for demo purposes -->
<script th:src="@{/asserts/dist/js/demo.js}"></script>
<!-- page script -->
<script>
    $("#all").click(function () {
        if (this.checked) {
            $(".checks").prop("checked", true);
            $("#all").prop("value", "全不选");
        } else {
            $(".checks").prop("checked", false);
            $("#all").prop("value", "全选");
        }
    });
</script>
</body>
</html>